﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutofacContrib.DynamicProxy2;

namespace Autofac {
    public interface IBankService {
        Bank GetById(string id);
        List<Bank> GetAll();
        void AddBank(Bank bank);
        string GetOPKey();
    }

    [Intercept(typeof(BankInterceptor))]
    public class BankService : IBankService {

        public Bank GetById(string id) {
            return new Bank { Name = "123" };
        }

        public void AddBank(Bank bank) {
            return;
        }

        public List<Bank> GetAll() {
            return new List<Bank> { new Bank { Name = "222" }, new Bank { Name = "333" } };
        }

        public string GetOPKey() {
            return "1";
        }
    }

    public class Bank {
        public string Name { get; set; }
    }
}
